<template>
  <!-- 顶部通栏 -->
  <nav class="app-topnav">
    <div class="container">
      <ul>
        <li v-if="profile.token">
          <a href="javascript:;"><i class="iconfont icon-user"></i>周杰伦</a>
        </li>
        <li><a href="javascript:;" v-if="profile.token">退出登录</a></li>
        <li><a href="javascript:;">请先登录</a></li>
        <li><a href="javascript:;">免费注册</a></li>
        <li><a href="javascript:;">我的订单</a></li>
        <li><a href="javascript:;">会员中心</a></li>
        <li><a href="javascript:;">帮助中心</a></li>
        <li><a href="javascript:;">关于我们</a></li>
        <li>
          <a href="javascript:;"><i class="iconfont icon-phone"></i>手机版</a>
        </li>
      </ul>
    </div>
  </nav>
</template>

<script>
import { reactive, toRefs, ref, computed, watch } from "vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";

export default {
  setup() {
    const router = useRouter();
    const store = useStore();
    // const {profile} = store.state.user.profile
    const data = reactive({
      profile: store.state.user.profile,
    });
    return { ...toRefs(data) };
  },
};
</script>
<style scoped lang="less">
.app-topnav {
  background: #333;
  ul {
    display: flex;
    height: 53px;
    justify-content: flex-end;
    align-items: center;
    li {
      a {
        padding: 0 15px;
        color: #cdcdcd;
        line-height: 1;
        display: inline-block;
        border-left: 2px solid #666;
        i {
          font-size: 14px;
          margin-right: 2px;
        }
        &:hover {
          a {
            color: @xtxColor;
          }
        }
        //   ~ li {
        //     a {
        //       border-left: 2px solid #666;
        //     }
        //   }
      }
    }
  }
}
</style>
